<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" type="text/css"
          href="easyui/themes/bootstrap/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="easyui/demo/demo.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="myjs/path.js"></script>
    <script type="text/javascript" src="myjs/store.js"></script>
    <script src="js/yangshi.js"></script>
    <script type="text/javascript" src="myjs/loader.js"></script>
</head>
<body class="easyui-layout">
<shiro:lacksPermission name="store:look">没有查询库存权限。。。</shiro:lacksPermission>
<shiro:hasPermission name="store:look">
<div id="p" data-options="region:'west',split:true" title="仓库菜单"
     style="width: 14%">
    <div style="margin: 0px 0;"></div>
    <div class="easyui-panel"
         style="padding: 0px; width: 250px; border-color: white;">
        <ul id="tt" class="easyui-tree" data-options="fit:true"></ul>
    </div>
</div>
<div data-options="region:'center'" title="仓库管理">
    <table id="dg" class="easyui-datagrid"
           data-options="rownumbers:true,singleSelect:true,method:'get',toolbar:'#tb',pagination:true,fit:true,striped:true,rowStyler:function(index,row){
			if (row.shuliang<=0){
				return 'background-color:rgba(255,0,0,0.6);color:white;font-weight:1000;';
			}
		}"
    >

    </table>
</div>

<div id="tb" style="padding: 5px; height: auto">
    <div>

        <select id="qubie" style="width: 100px;" class="easyui-combobox"
                data-options="editable:false,panelHeight:'auto'">
            <option value="2">全部</option>
            <option value="1">正库存</option>
            <option value="0">负库存</option>
        </select>
        年<input id="year"class="easyui-combobox" style="width: 120px;"  data-options="valueField:'year',textField:'year',panelHeight:'auto'">
        季<input id="season" class="easyui-combobox" style="width: 120px;" data-options="valueField:'season',textField:'season',panelHeight:'auto'">
        品牌<input id="brand" class="easyui-combobox" style="width: 120px;" data-options="valueField:'pinpai',textField:'pinpai',panelHeight:'auto'">


        <label id='zt11'><input id='zt1' type='radio'
                                onclick='A()' name='tj' value='0'><span>按尺码</span></label>
        <label id='zt22'><input id='zt2' type='radio' onclick='A()'
                                name='tj' value='1'><span>按颜色</span></label>
        <label id='zt33'><input
                id='zt3' type='radio' onclick='A()' checked='checked' name='tj'
                value='2'>按款号</label>
        <%--<strong>关键词:</strong> --%><input id="kuanhao" class='textbox'
                                     style="width: 150px;height:22px; border-radius: 6px"
                                     placeholder="键入名称/款号/编号"></input>
        <span title="点击Enter进行快捷搜索" class="easyui-tooltip"
              data-options="position: 'top'"><a id="btn" href="#"
                                                class="easyui-linkbutton" iconCls="icon-search"
                                                onclick="A()">搜索</a></span>
          <%--<input id="kuanhao" class="easyui-searchbox"
                   data-options="searcher:A,prompt:'请输入款号关键词'">--%>

        <a href="#" class="easyui-linkbutton"
           data-options="iconCls:'icon-reload',plain:true" onclick="chongZhiss()">重置搜索</a>
        <label id='ciping' style='float:right'><input id='cipin' type='checkbox'
                                                      onclick='A()'><span>查看次品</span></label>

    </div>
    <input id='jgid' type="hidden" value="<%=request.getParameter("jgid")%>">
    </shiro:hasPermission>
</body>
</html>
<script>
    $(function () {
        $.ajax({
            url: path + "/production/selectallattr.do",
            type: 'post',
            dataType: "json",
            success: function (data) {
                console.log(data)
                $('#season').combobox("loadData", data.data.seasonx);
                $('#year').combobox("loadData", data.data.yearx);
                $('#brand').combobox("loadData", data.data.pinpaix);
            }
        })
    })


    /*入库下面表格*/
    $("#dg").datagrid({
        method: 'GET',
        striped: true,
        rownumbers: true,
        singleSelect: true,
        toolbar: '#tb',
        checkbox: false,
        fit: true,
        fitColumns: false,
        autoRowHeight: false,
        pagination: true,
        pageSize: 20,
        pageList: [10, 20,50, 100],
        nowrap: true,
        loadMsg: '加载中,请稍后......',
        columns: [[{
            field: 'id',
            title: '商品编号',
            width: 80,
            hidden: true
        }, {
            field: 'product',
            title: '商品款号',
            width: 150,
            align: 'center'
        }, {
            field: 'productCode',
            title: '商品编号',
            width: 200,
            align: 'center'
        }, {
            field: 'productName',
            title: '商品名称',
            width: 120,
            align: 'center'
        }, {
            field: 'price',
            title: '铭牌价/￥',
            width: 80,
            align: 'center'
        }, {
            field: 'color',
            title: '颜色',
            width: 80,
            align: 'center'
        }, {
            field: 'size',
            title: '尺码',
            width: 80,
            align: 'center'
        }, {
            field: 'cpYear',
            title: '年份',
            width: 80,
            align: 'center'
        },{
            field: 'season',
            title: '季节',
            width: 80,
            align: 'center'
        },{
            field: 'pinpai',
            title: '商品品牌',
            width: 80,
            align: 'center'
        }, {
            field: 'style',
            title: '款型',
            width: 80,
            align: 'center'
        }, {
            field: 'shuliang',
            title: '库存数量',
            width: 80,
            align: 'center'
        }
        ]],
        onLoadSuccess: function (data) {
           if (data.rows.length==0){
              // alert("暂无符合查询结果的商品");
           }
            /*   var fenlei = $(".fenlei:checked").val();
               if (fenlei == 0) {
                   $("#dgChildren").datagrid('hideColumn', 'color');
                   $("#dgChildren").datagrid('hideColumn', 'size');
               } else if (fenlei == 1) {
                   $("#dgChildren").datagrid('showColumn', 'color');
                   $("#dgChildren").datagrid('hideColumn', 'size');
               } else {
                   $("#dgChildren").datagrid('showColumn', 'color');
                   $("#dgChildren").datagrid('showColumn', 'size');
               }*/
        }
    });


</script>